#include <iostream>
#include <map>
#include <algorithm> //std::for_each
using namespace std;
void printPair(const pair<int,int>& elem)
{
    cout << elem.first << "->" << elem.second << endl;
}

int main()
{
    map<int,int> myMap;
    myMap.insert(make_pair(4,40));
    myMap.insert(make_pair(5,50));
    myMap.insert(make_pair(6,60));
    for_each(myMap.begin(),myMap.end(),printPair);
    return 0;
}